Optimal. Leaf size=129 \[ \frac {x \left (c^3-3 i c^2 d+3 c d^2+3 i d^3\right )}{2 a}-\frac {d^2 (c+3 i d) \tan (e+f x)}{2 a f}+\frac {d^2 (-d+3 i c) \log (\cos (e+f x))}{a f}+\frac {(-d+i c) (c+d \tan (e+f x))^2}{2 f (a+i a \tan (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.16, antiderivative size = 129, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.107, Rules used = {3550, 3525, 3475} \[ \frac {x \left (-3 i c^2 d+c^3+3 c d^2+3 i d^3\right )}{2 a}-\frac {d^2 (c+3 i d) \tan (e+f x)}{2 a f}+\frac {d^2 (-d+3 i c) \log (\cos (e+f x))}{a f}+\frac {(-d+i c) (c+d \tan (e+f x))^2}{2 f (a+i a \tan (e+f x))} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3475
Rule 3525
Rule 3550
Rubi steps
\begin {align*} \int \frac {(c+d \tan (e+f x))^3}{a+i a \tan (e+f x)} \, dx &=\frac {(i c-d) (c+d \tan (e+f x))^2}{2 f (a+i a \tan (e+f x))}+\frac {\int (c+d \tan (e+f x)) \left (a \left (c^2-3 i c d+2 d^2\right )-a (c+3 i d) d \tan (e+f x)\right ) \, dx}{2 a^2}\\ &=\frac {\left (c^3-3 i c^2 d+3 c d^2+3 i d^3\right ) x}{2 a}-\frac {(c+3 i d) d^2 \tan (e+f x)}{2 a f}+\frac {(i c-d) (c+d \tan (e+f x))^2}{2 f (a+i a \tan (e+f x))}-\frac {\left ((3 i c-d) d^2\right ) \int \tan (e+f x) \, dx}{a}\\ &=\frac {\left (c^3-3 i c^2 d+3 c d^2+3 i d^3\right ) x}{2 a}+\frac {(3 i c-d) d^2 \log (\cos (e+f x))}{a f}-\frac {(c+3 i d) d^2 \tan (e+f x)}{2 a f}+\frac {(i c-d) (c+d \tan (e+f x))^2}{2 f (a+i a \tan (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 2.84, size = 236, normalized size = 1.83 \[ \frac {\sec (e+f x) (\cos (f x)+i \sin (f x)) \left (2 f x \left (c^3-3 i c^2 d+3 c d^2+3 i d^3\right ) (\cos (e)+i \sin (e))-4 d^2 f x (3 c+i d) (\cos (e)+i \sin (e))+2 i d^2 (3 c+i d) (\cos (e)+i \sin (e)) \log \left (\cos ^2(e+f x)\right )+4 d^2 (3 c+i d) (\cos (e)+i \sin (e)) \tan ^{-1}(\tan (f x))+(c+i d)^3 (\sin (e)+i \cos (e)) \cos (2 f x)+(c+i d)^3 (\cos (e)-i \sin (e)) \sin (2 f x)+4 d^3 (\tan (e)-i) \sin (f x) \sec (e+f x)\right )}{4 f (a+i a \tan (e+f x))} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.51, size = 202, normalized size = 1.57 \[ \frac {{\left (2 \, c^{3} - 6 i \, c^{2} d + 18 \, c d^{2} + 10 i \, d^{3}\right )} f x e^{\left (4 i \, f x + 4 i \, e\right )} + i \, c^{3} - 3 \, c^{2} d - 3 i \, c d^{2} + d^{3} + {\left (i \, c^{3} - 3 \, c^{2} d - 3 i \, c d^{2} + 9 \, d^{3} + {\left (2 \, c^{3} - 6 i \, c^{2} d + 18 \, c d^{2} + 10 i \, d^{3}\right )} f x\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + {\left ({\left (12 i \, c d^{2} - 4 \, d^{3}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (12 i \, c d^{2} - 4 \, d^{3}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )}{4 \, {\left (a f e^{\left (4 i \, f x + 4 i \, e\right )} + a f e^{\left (2 i \, f x + 2 i \, e\right )}\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.95, size = 186, normalized size = 1.44 \[ -\frac {\frac {4 i \, d^{3} \tan \left (f x + e\right )}{a} - \frac {{\left (i \, c^{3} + 3 \, c^{2} d - 3 i \, c d^{2} - d^{3}\right )} \log \left (\tan \left (f x + e\right ) + i\right )}{a} + \frac {{\left (i \, c^{3} + 3 \, c^{2} d + 9 i \, c d^{2} - 5 \, d^{3}\right )} \log \left (-i \, \tan \left (f x + e\right ) - 1\right )}{a} + \frac {-i \, c^{3} \tan \left (f x + e\right ) - 3 \, c^{2} d \tan \left (f x + e\right ) - 9 i \, c d^{2} \tan \left (f x + e\right ) + 5 \, d^{3} \tan \left (f x + e\right ) - 3 \, c^{3} - 3 i \, c^{2} d - 3 \, c d^{2} - 3 i \, d^{3}}{a {\left (\tan \left (f x + e\right ) - i\right )}}}{4 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.19, size = 288, normalized size = 2.23 \[ -\frac {i d^{3} \tan \left (f x +e \right )}{f a}+\frac {3 \ln \left (\tan \left (f x +e \right )+i\right ) c^{2} d}{4 f a}-\frac {\ln \left (\tan \left (f x +e \right )+i\right ) d^{3}}{4 f a}+\frac {i \ln \left (\tan \left (f x +e \right )+i\right ) c^{3}}{4 f a}-\frac {3 i \ln \left (\tan \left (f x +e \right )+i\right ) c \,d^{2}}{4 f a}-\frac {3 \ln \left (\tan \left (f x +e \right )-i\right ) c^{2} d}{4 f a}+\frac {5 \ln \left (\tan \left (f x +e \right )-i\right ) d^{3}}{4 f a}-\frac {i \ln \left (\tan \left (f x +e \right )-i\right ) c^{3}}{4 f a}-\frac {9 i \ln \left (\tan \left (f x +e \right )-i\right ) c \,d^{2}}{4 f a}+\frac {3 i c^{2} d}{2 f a \left (\tan \left (f x +e \right )-i\right )}-\frac {i d^{3}}{2 f a \left (\tan \left (f x +e \right )-i\right )}+\frac {c^{3}}{2 f a \left (\tan \left (f x +e \right )-i\right )}-\frac {3 c \,d^{2}}{2 f a \left (\tan \left (f x +e \right )-i\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: RuntimeError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 5.66, size = 175, normalized size = 1.36 \[ -\frac {\frac {3\,c^2\,d-d^3}{2\,a}+\frac {\left (d^3\,1{}\mathrm {i}+3\,c\,d^2\right )\,1{}\mathrm {i}}{2\,a}-\frac {-d^3+c^3\,1{}\mathrm {i}}{2\,a}}{f\,\left (1+\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}-\frac {d^3\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}}{a\,f}-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (-c^3\,1{}\mathrm {i}-3\,c^2\,d+c\,d^2\,3{}\mathrm {i}+d^3\right )}{4\,a\,f}-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,\left (c^3\,1{}\mathrm {i}+3\,c^2\,d+c\,d^2\,9{}\mathrm {i}-5\,d^3\right )}{4\,a\,f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.86, size = 267, normalized size = 2.07 \[ - \frac {2 d^{3}}{- a f e^{2 i e} e^{2 i f x} - a f} + \begin {cases} - \frac {\left (- i c^{3} + 3 c^{2} d + 3 i c d^{2} - d^{3}\right ) e^{- 2 i e} e^{- 2 i f x}}{4 a f} & \text {for}\: 4 a f e^{2 i e} \neq 0 \\x \left (- \frac {c^{3} - 3 i c^{2} d + 9 c d^{2} + 5 i d^{3}}{2 a} + \frac {i \left (- i c^{3} e^{2 i e} - i c^{3} - 3 c^{2} d e^{2 i e} + 3 c^{2} d - 9 i c d^{2} e^{2 i e} + 3 i c d^{2} + 5 d^{3} e^{2 i e} - d^{3}\right ) e^{- 2 i e}}{2 a}\right ) & \text {otherwise} \end {cases} + \frac {i d^{2} \left (3 c + i d\right ) \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{a f} - \frac {x \left (- c^{3} + 3 i c^{2} d - 9 c d^{2} - 5 i d^{3}\right )}{2 a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________